const { get_fst_file } = require("../utils/file_tool");
const { BaseCommand } = require("./base");

class ReadExcelCommand extends BaseCommand {
    async execute() {
        const filename = get_fst_file(this.selfData.src);
        const Excel = require("exceljs");
        // read from a file
        const workbook = new Excel.Workbook();
        const ret = await workbook.xlsx.readFile(filename);
        return ret;
    }
}

module.exports = {
    ReadExcelCommand,
};
